package com.cykj.pos.mapper;

import com.cykj.pos.domain.AizFlowFee;
import com.cykj.pos.domain.AllocationRelation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cykj.pos.domain.vo.SettlementVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 划拨-机具层级关系Mapper接口
 *
 * @author weijianbo
 * @date 2025-01-20
 */
public interface AllocationRelationMapper extends BaseMapper<AllocationRelation> {

    AllocationRelation selectInfoBySnAndMerchId(@Param("sn") String sn, @Param("merchId")Long merchId);

    int getMySnCount(Long merchId);

    int getMyTeamSnCount(Long merchId);

    int getMyTeamActiveSnCount(Long merchId);

    List<SettlementVO> getMySettlementPolicy(Long merchId);

    List<SettlementVO> getDefaultFlowFeePolicy();

    Double getRelationByMaxLevelAndSn(String posCode);

    void deleteGreaterThanMyLevel(@Param("sn") String sn, @Param("level") Long level);

    void deleteBySn(String sn);

    AllocationRelation selectGreaterThanMyLevel(@Param("sn") String sn, @Param("level") Long level);

    void updateValueByFieldAndId(AllocationRelation allocationRelation);

    void updateRecords(@Param("loginUser")String loginUser, @Param("content")String content);
}
